#ifndef VIEW_INFO_H
#define VIEW_INFO_H


#include "vector.h"
#include "matrix.h"


class viewInfo
{
	mdsVector<3, double> m_viewCenter;
	mdsMatrix<3, double> m_viewFrame; // look=0, left=1, up=2
	mdsVector<3, double> m_viewOffset;
	// mdsVector<3, double> m_viewOffset;
public:
	viewInfo(void);
	~viewInfo(void);

	viewInfo(const viewInfo & src)
	{
		m_viewCenter = src.m_viewCenter; m_viewFrame = src.m_viewFrame; m_viewOffset = src.m_viewOffset;
	}

	const viewInfo & operator=(const viewInfo & src)
	{
		m_viewCenter = src.m_viewCenter; m_viewFrame = src.m_viewFrame; m_viewOffset = src.m_viewOffset;
		return *this;
	}

	const mdsVector<3, double> & GetAnchor() const;
	mdsVector<3, double> GetPosition() const;

	mdsVector<3, double> GetLookDir() const;
	mdsVector<3, double> GetLeftDir() const;
	mdsVector<3, double> GetUpDir() const;

	mdsVector<3, double> XformVecRotOnly(const mdsVector<3, double> & vecIn) const 
	{
		return m_viewFrame.preMultVec(vecIn);
	}

	void RotateBy(mdsMatrix<3, double> rotMatPreMultConvention); // uses pre-multiply convention if rotating in global frame
	
	void RotateByLcl(mdsMatrix<3, double> rotMatPostMultConvention); // uses pre-multiply convention if rotating in local frame

	double GetViewBack() const;

	void SetViewBack(double lfViewDist);

	void MoveViewBack(double lfViewDist);

	void SetAnchor(mdsVector<3, double> vecNewAnchor);

	void TranslateAnchorBy(mdsVector<3, double> vecAnchorTranslation);

	void SetGlViewTo() const;
};

#endif